package com.ruoyi.web.controller.openapi;

import openapi.sdk.common.annotation.OpenApiDoc;
import openapi.server.sdk.annotation.OpenApi;
import openapi.server.sdk.annotation.OpenApiMethod;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * 开放式接口
 */
@OpenApiDoc(cnName = "用户API", describe = "用户对外服务接口")
@OpenApi("userApi")
public class UserApi {

    protected Logger logger = LoggerFactory.getLogger(UserApi.class);

    @OpenApiMethod("getUserById")
    public Map<String, Object> getUserById(Long id) {
        logger.info("getUserById：id={}", id);
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("name", "admin");
        return map;
    }
}
